import * as vscode from 'vscode';

export class globalData {
    private static _sdkVersion: string;
    static get sdkVersion() {
        return this._sdkVersion;
    }
    static set sdkVersion(sdkVersion: string) {
        this._sdkVersion = sdkVersion;
    }

    private static _extensionPath: string;
    static get extensionPath() {
        return this._extensionPath;
    }

    private static _sdkPath: string;
    static get sdkPath() {
        return this._sdkPath;
    }

    private static _modulesPath: string;
    static get modulesPath() {
        return this._modulesPath;
    }

    static init(context: vscode.ExtensionContext) {
        this._extensionPath = context.extensionPath;
        const config = vscode.workspace.getConfiguration("cangjieTools");
        this._sdkPath = config.inspect<string>('sdkPath')?.globalValue ?? '';
        this._modulesPath = config.inspect<string>('intellisensesModulesPath')?.globalValue ?? '';
    }
}